package com.zzj.ecology.system.domain;

import com.zzj.ecology.common.utils.StringUtils;

import java.io.Serializable;

/**
 * @ClassName Paging
 * @Description TODO
 * @Author zhijun zeng at 14:37 2020/5/30
 * @Version 1.0
 **/
public class Paging implements Serializable {

    private Integer pageSize;
    private Integer offset;

    private String orderByColumn;
    private String sort;// 排序 asc desc

    public String getOrderBy() {
        if (StringUtils.isEmpty(orderByColumn)) {
            return "";
        }
        return StringUtils.toUnderScoreCase(orderByColumn) + " " + sort;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public String getOrderByColumn() {
        return orderByColumn;
    }

    public void setOrderByColumn(String orderByColumn) {
        this.orderByColumn = orderByColumn;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }
}
